<?php
/**
 * Medoo数据库驱动
 */
require_once dirname(__FILE__) . '/Medoo.php';
class Medoo_Lite extends Medoo {
    public function __construct($dbConfig,$debug=false){
        if ($dbConfig['servers'] && $dbConfig['tables']){
            $defult = $dbConfig['tables']['__default__'];
            $servers = $dbConfig['servers'][$defult['map'][0]['db']];
            if (!isset($servers['type'])){
                $options['database_type'] = 'mysql';
            }else{
                $options['database_type'] = $servers['type'];
            }
            $options['database_name'] = $servers['name'];
            $options['server'] = $servers['host'];
            $options['username'] = $servers['user'];
            $options['password'] = $servers['password'];
            $options['port'] = $servers['port'];
            $options['charset'] = $servers['charset'];
            $options['prefix'] = $defult['prefix'];
            parent::__construct($options,$debug);
        }else{
            exit('dbConfig not exit');
        }
   }

}